#include "StdAfx.h"
#include ".\imageproc.h"

#include "FreeImage.h"

CImageProc::CImageProc(void)
{
}

CImageProc::~CImageProc(void)
{
}

int CImageProc::Crop( const char* srcFile, const char* dstFile, int left, int top, int right, int bottom )
{
	FREE_IMAGE_FORMAT fif = FreeImage_GetFileType(srcFile);
	FIBITMAP *dib = FreeImage_Load(fif, srcFile, 0);

	int width = FreeImage_GetWidth(dib);
	int height = FreeImage_GetHeight(dib);

	BOOL bSuccess = FreeImage_JPEGCrop(srcFile, dstFile, left, top, right, bottom);

	return 0;
}
